package com.wipz.eoa.iphone.fixedassets;

import java.util.HashMap;
import java.util.Map;

import com.wipz.eoa.iphone.BaseAction;
import com.wipz.eoa.iphone.IBaseService;
import com.wipz.eoa.iphone.businessProcess.AgencyCoreService;
import com.wipz.eoa.iphone.util.Constants;

/**
 * �̶��ʲ������
 * @version 1.0
 */
public class FixedAssetsScrapApplyAction extends BaseAction{
	private static final long serialVersionUID = 1L;
	private IBaseService baseService;
	private Map detail;
	private AgencyCoreService agencyCoreService;
	

	public void setAgencyCoreService(AgencyCoreService agencyCoreService) {
		this.agencyCoreService = agencyCoreService;
	}

	public Map getDetail() {
		return detail;
	}

	public void setDetail(Map detail) {
		this.detail = detail;
	}

	public void setBaseService(IBaseService baseService) {
		this.baseService = baseService;
	}
	
	/**
	 * �鿴�̶��ʲ������,���ID
	 * Function-�鿴:ID 
	 * @return
	 */
	public String detail() {
		String COMMITERCODE = this.getRequest().getParameter("COMMITERCODE");
		String taskId = this.getRequest().getParameter("taskId");
		Map params = new HashMap();
		params.put("id", this.getRequest().getParameter("id"));
		detail = (Map) baseService.queryOne("fixedAssets.queryOpID", params);
		
		detail.put("taskId", taskId == null ? "" : taskId);
		
		Map newMap = (Map) baseService.queryOne("businessProcess.queryByCode",detail);
		String processId = newMap == null ? "":(String)newMap.get("PROCESSID") ;
		detail.put("processInstanceId", processId);
		if(null == COMMITERCODE || COMMITERCODE.isEmpty()) {
			return SUCCESS;
		}
		String userId = (String) baseService.queryOne("user.queryId",COMMITERCODE);
		detail = agencyCoreService.agencyList(Constants.ASSETSSCRAPAPPLY_BUSINESS_ID, userId,detail);
		return SUCCESS;
	}
}
